const PREFIX = '/admin/menu'
import request from '@/request/request.js'

/**
 * 获取菜单列表
 * @returns {*}
 */
export const getMenuList = () => request(`${PREFIX}/list`)

/**
 * 添加菜单
 * @param data 表单数据
 * @returns {*}
 */
export const addMenu = (data) => request(`${PREFIX}/addMenu`, data, 'post')

/**
 * 获取菜单
 * @returns {*}
 * @param id
 */
export const getMenuById = (id) => request(`${PREFIX}/getMenuById/${id}`)

/**
 * 修改菜单
 * @param data 表单数据
 * @returns {*}
 */
export const updateMenu = (data) => request(`${PREFIX}/updateMenu`, data, 'post')

/**
 * 删除菜单
 * @returns {*}
 * @param id
 */
export const deleteMenu = (id) => request(`${PREFIX}/deleteMenu/${id}`)
